<template>
    <!-- 贷后管理 -->
    <div>
        <div class="fksh">
            <p>贷款五级分类</p>
            <!-- 搜索框 -->
            <div class="qymc">
                <el-select v-model="value" class="m-2" placeholder="企业名称">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"
                        size="small" />
                </el-select>
            </div>
            <div class="ssk">
                <el-input v-model="input1" class="w-50 m-2" placeholder="请输入要查询的核心企业名称">
                    <template #prefix>
                        <el-icon class="el-input__icon">
                            <search />
                        </el-icon>
                    </template>
                </el-input>
            </div>
            <div class="hxqy">
                <el-select v-model="value2" class="m-2" placeholder="五级分类">
                    <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value"
                        size="small" />
                </el-select>
            </div>
            <!-- 按钮 -->
            <div class="anniu">
                <el-button type="primary">查询</el-button>
                <el-button class="cz">重置</el-button>
                <el-button class="dc"><el-icon>
                        <DocumentChecked />
                    </el-icon>导出</el-button>
                <el-button class="xz"><el-icon>
                        <Plus />
                    </el-icon>新增</el-button>
            </div>
            <!-- 表格 -->
            <div class="bg">
                <el-table :data="tableData" style="width: 100%">
                    <el-table-column label="序号" width="60">
                        <template #default="scope">
                            <div style="display: flex; align-items: center">
                                <span>{{ scope.$index + 1 }}</span>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="借款品种" width="120">
                        <template #default="scope">
                            <div style="display: flex; align-items: center">
                                <span style="margin-left: 10px">{{ scope.row.jiekuanpinzhong }}</span>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="企业名称" width="190">
                        <template #default="scope">
                            <div style="display: flex; align-items: center">
                                <span style="margin-left: 10px">{{ scope.row.name }}</span>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="社会信用代码">
                        <template #default="scope">
                            <div style="display: flex; align-items: center">
                                <span style="margin-left: 10px">{{ scope.row.daima }}</span>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="借款金额">
                        <template #default="scope">
                            <div style="display: flex; align-items: center">
                                <span style="margin-left: 10px">{{ scope.row.jiekuanjine }}</span>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="借款期限">
                        <template #default="scope">
                            <div style="display: flex; align-items: center">
                                <span style="margin-left: 10px">{{ scope.row.jiekuanqixian }}</span>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="还款状况">
                        <template #default="scope">
                            <div style="display: flex; align-items: center">
                                <span style="margin-left: 10px">{{ scope.row.huankuanzk }}</span>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="分类等级">
                        <template #default="scope">
                            <div style="display: flex; align-items: center">
                                <span style="margin-left: 10px">{{ scope.row.fenleidengji }}</span>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <!-- 分页 -->
            <div class="fy">
                <el-pagination v-model:current-page="currentPage4" v-model:page-size="pageSize4" :page-sizes="[10, 15]"
                    :small="small" :disabled="disabled" :background="background"
                    layout="total, sizes, prev, pager, next, jumper" :total="tableData.length"
                    @size-change="handleSizeChange" @current-change="handleCurrentChange" />
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { reactive, ref } from 'vue'
import { Search } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'

const router = useRouter()

const currentPage4 = ref()
const pageSize4 = ref()
const small = ref(false)
const background = ref(false)
const disabled = ref(false)
const handleSizeChange = (val: number) => {
    console.log(`${val} items per page`)
}
const handleCurrentChange = (val: number) => {
    console.log(`current page: ${val}`)
}


const input1 = ref('')
const value = ref('')
const value2 = ref('')


const tableData = [
    {
        jiekuanpinzhong: '应收账款保理',
        name: 'ABC有限公司',
        daima: '123456789',
        jiekuanjine: '10,000,000.00',
        jiekuanqixian: '3年',
        huankuanzk: '逾期',
        fenleidengji: '次级',
    },
    {
        jiekuanpinzhong: '应收账款保理',
        name: 'ABC有限公司',
        daima: '123456789',
        jiekuanjine: '10,000,000.00',
        jiekuanqixian: '3年',
        huankuanzk: '逾期',
        fenleidengji: '次级',
    },
]


const options = [
    {
        value: '企业名称',
        label: '企业名称',
    },
    {
        value: '社会信用代码',
        label: '社会信用代码',
    },
]

const options2 = [
    {
        value: '全部',
        label: '全部',
    },
    {
        value: '正常',
        label: '正常',
    },
    {
        value: '关注',
        label: '关注',
    },
    {
        value: '损失',
        label: '损失',
    },
    {
        value: '次级',
        label: '次级',
    },
    {
        value: '可疑',
        label: '可疑',
    },
]



</script>

<style scoped>
.fksh p {
    background-color: rgb(78, 171, 254);
    color: #fff;
    width: 200px;
    height: 40px;
    border-radius: 50px;
    text-align: center;
    line-height: 40px;
}

.fksh .qymc {
    display: inline-block;
    width: 100px;

}

.fksh .ssk {
    display: inline-block;
    width: 250px;
    margin: 0 20px;
}

.fksh .zt,
.hxqy {
    display: inline-block;
    margin: 0 20px 0 0;
    width: 100px;
}

.fksh .dc,
.xz,
.cz {
    color: rgb(78, 171, 254);
}

.fksh .anniu {
    display: inline-block;
}

.fksh .anniu .dc {
    margin-left: 250px;
}



.demo-pagination-block+.demo-pagination-block {
    margin-top: 10px;
}

.demo-pagination-block .demonstration {
    margin-bottom: 16px;
}

.el-pagination {
    justify-content: center;
}

.fksh .el-table tr th {
    text-align: center;
}
</style>